package dao

import (
	"server/basic/config"
	"server/basic/model"
)

func ConsultationAdd(name string, url string, id int32, t int32, content string) (patient model.ThePatients, err error) {
	patient = model.ThePatients{
		UserId:  int64(id),
		Name:    name,
		Content: content,
		Url:     url,
		Type:    t,
	}
	err = config.DB.Create(&patient).Error
	if err != nil {
		return model.ThePatients{}, err
	}
	return patient, nil
}
